<template>
	<view class="page">
		<!-- 用户信息 -->
		<view class="user-info">
			<view class="user-data" @click="onUserInfo">
				<view class="portrait-nickname">
					<view class="portrait">
						<image :src="userInfo.avatar" mode=""></image>
					</view>
					<view class="nickname">
						<text>{{userInfo.nickname}}</text>
					</view>
				</view>
				<view class="more">
					<text class="iconfont icon-more"></text>
				</view>
			</view>
			<view class="address" @click="onAddress">
				<view class="title">
					<text>地址管理</text>
				</view>
				<view class="more">
					<text class="iconfont icon-more"></text>
				</view>
			</view>
		</view>
		<!-- 退出 -->
		<view class="quit-login" @click="onQuitLogin">
			<text>退出登录</text>
		</view>
		<!-- 提示框 -->
		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>

<script>
	import {getAddress} from '@/config/api.js'
	export default {
		data() {
			const userInfo = uni.getStorageSync('userInfo');
			return {
				userInfo
			};
		},
		methods: {
			/**
			 * 用户信息点击
			 */
			onUserInfo() {
				uni.navigateTo({
					url: '/pages/Information/Information'
				})
			},
			/**
			 * 地址点击
			 */
			onAddress() {
				
				uni.navigateTo({
					url: '/moduleB/AddressList/AddressList',
				})
			},
			/**
			 * 退出点击
			 */
			onQuitLogin() {
				this.$refs['DialogBox'].confirm({
					title: '提示',
					content: '是否要退出登录?',
					DialogType: 'inquiry',
					animation: 0
				}).then(() => {
					uni.navigateBack();
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'Setting.scss';
</style>